import Vue from 'vue'
import VueRouter from 'vue-router'
// import Test from '@/components/test/Test.vue'
import login from '@/views/login/login.vue'
import register from '@/views/login/register.vue'
import index from '@/views/student/index.vue'
import space from '@/views/space.vue'
import info from '@/views/student/info.vue'
import rank from '@/views/rank.vue'
// import choose from '@/views/exercise/choose.vue'
// import doexercise from '@/views/exercise/doexercise.vue'
import newexercise from '@/views/newexercise/newexercise.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'Test',
        component: login
    }, {
        path: '/login', // 登录界面
        name: 'login',
        component: login
    }, {
        path: '/register',
        name: 'register',
        component: register
    }, {
        path: '/index',
        name: 'index',
        component: index
    },{
        path: '/space',
        name: 'space',
        component: space,
        children:[
            {
                path: 'info',
                name: 'index',
                component: info
            },
            {
                path: 'exercise',
                name: 'newexercise',
                component: newexercise,
            },
            // {
            //     path: 'exercise',
            //     name: 'choose',
            //     component: choose,
            // },
            // {
            //     path:'exercise/problems',
            //     name:'doexercise',
            //     component: doexercise
            // },
            {
                path: 'rank',
                name: 'rank',
                component: rank
            }
        ]
    },
]

const router = new VueRouter({
    routes
})

export default router
